import {
	cloneDeep,
	isEqual,
	isString,
	forEach
} from 'lodash';
import dayjs from 'dayjs'
import {
	getImage,
	getSourceUrl,
	isWechat,
	copy,
	onBlock
} from '@/codecat/utils/index.js'

import {
	getDict
} from '@/codecat/config/index.js'
import mixin from '@/codecat/mixins';

const install = Vue => {
	Vue.config.productionTip = false; // 关闭生产提示
	Vue.prototype.$api = {}; // 全局挂载api
	Vue.prototype.$lodash = {
		cloneDeep,
		isEqual,
		isString,
		forEach
	}
	Vue.prototype.$dayjs = dayjs
	Vue.prototype.getImage = getImage;
	Vue.prototype.$getSourceUrl = getSourceUrl;
	Vue.prototype.$getDict = getDict
	Vue.prototype.$copy = copy
	Vue.prototype.$onBlock = onBlock

	Vue.mixin(mixin);
	// removePageHead()
}

function removePageHead() {
	if (isWechat()) {
		let style = document.createElement('style');
		style.type = 'text/css';
		style.innerHTML = "uni-page-head{display:none !important;}";
		document.getElementsByTagName('head').item(0).appendChild(style);
	}
}

export default {
	install
}